<?php

/* Delete Course */
$setting_error=0;
$msg=0;
$courseerror=0;
?>
<!--Delete Form-->               
<form action="#" name="delete_cform" id="delete_cform" method="POST">
<input type="hidden" name="del_id" id="del_id" value="" />
<input type="hidden" name="delsubmit" value="<?php echo time(); ?>" />
</form>
<!--Delete Form-->
<!-- mobile navigation -->
			<nav id="mobile_navigation"></nav>
			
			<section id="breadcrumbs">
				<div class="container">
					<ul>
						<li><a href="#">Prime-school </a></li>
                        <li><a href="#">Settings </a></li>
						<li><span>Department</span></li>						
					</ul>
				</div>
			</section>
			<section class="container clearfix main_section">
				<div id="main_content_outer" class="clearfix">
					<div id="main_content">
						<div class="alert alert-info"><strong>Department</strong></div>
                         <?php 
						if($setting_error==1)
						{
						?>
                        <div class="warning">Hello ! Please <a href="general_setting.php" />Click Here</a> Complete your settings page. It is very important to fill up your general settings before you start.</div>
                        <?php
						}?>
                        <?php 
						if($msg==1)
						{
						?>
                        <div class="success">Department detail has been saved successfully</div>
                        <?php
						}?> 
                          <?php 
						if($courseerror==1)
						{
						?>
                        <div class="error">This Department is available</div>
                        <?php
						}?> 
						<!-- main content -->
        
                        <form action="#" method="POST" id="course" name="course" enctype="multipart/form-data">
						<div class="row">
							<div class="col-sm-12">
								<div class="panel panel-default">
									<!--<div class="panel-heading">
										<h4 class="panel-title">Simple Validation</h4>
									</div>-->
									<div class="panel-body">
										
											<div class="form_sep">
												<label for="reg_input_name" class="req">Department ID</label>
												<input type="text" id="course" name="course" class="form-control" data-required="true" >
											</div>
                                            
                                            <div class="form_sep">
												<label for="reg_textarea_message" class="">Department Short Name</label>
												<input type="text"  name="section" id="section" cols="30" rows="4" class="form-control"  >
											</div>
											<div class="form_sep">
												<label for="reg_input_email" class="req">Department Full Name</label>
												<input type="text" id="code" name="code" class="form-control" data-required="true" >
											</div>
									</div>
								</div>
							</div>
						</div>
						<div class="row">
							<div class="col-sm-5">
							<div class="form_sep">
							<button class="btn btn-success" type="submit" name="course_submit" id="course_submit" >Save</button>
							</div>
                            </div>
                           
                            
						</div>
						</form>
                        <div style="margin-top:20px;">
						<div class="row">
							<div class="col-sm-12"> 
							<div class="panel panel-default">
                           
							<?php  
							if(count($dept_list)>0)
							{?>
                            <div class="panel-heading">
										<h4 class="panel-title"> Department List </h4>
									</div>
							<div class="panel_controls">
										<div class="row">
											<div class="col-sm-4">
												<label for="table_search">Search:</label>
												<input type="text" id="table_search" class="form-control">
											</div>
											<div class="col-sm-3 col-xs-6">
												
											</div>
											<div class="col-sm-3 col-xs-6">
												
											</div>
										</div>
									</div>
                            <table id="resp_table" class="table toggle-square" data-filter="#table_search" data-page-size="40">
										<thead>
											<tr>
												<th data-toggle="true">Department ID</th>
												<th data-hide="phone,tablet">Department Short Name</th>
												<th data-hide="phone,tablet"> Department Full Name</th>
                                                <th data-hide="phone,tablet"> View / Edit</th>
                                                <th > Delete</th>
											</tr>
										</thead>
										<tbody>
                                        <?php foreach($dept_list as $list)
										{?>
											<tr>
                                            <td><?php echo $list['dept_id']; ?></td>
                                            <td><?php echo $list['dept_short_name']; ?></td>
                                            <td><?php echo $list['dept_name']; ?></td>
                                            <td><a href="<?php echo base_url(); ?>course.php?id=<?php echo $list['dept_id']; ?>"><img src="<?php echo base_url(); ?>assets/img/edit.png" /></a></td>
                                            <td><a href="#"><img src="img/error.png" class="deletecourse" name="del" id="del" del_id="<?php echo $list['dept_id']; ?>" title="Remove " /></a></td>
                                            </tr>
                                        <?php } ?>
											
										</tbody>
										<tfoot class="hide-if-no-paging">
											<tr>
												<td colspan="6" class="text-center">
													<ul class="pagination pagination-sm"></ul>
												</td>
											</tr>
										</tfoot>
									</table>
                            <?php } ?>
							</div>
                            </div>
						</div>
						</div>
							
						</div>
					</div>
				
			</section>
			<div id="footer_space"></div>
		</div>
	